package cn.itsource.feignclient;

import cn.itsource.course.doc.CourseDoc;
import cn.itsource.course.query.CourseQuery;
import cn.itsource.fallback.EsFallbackFactory;
import cn.itsource.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//负载均衡器负载调用redis数据库,调用哪个服务
@FeignClient(value = "es-server", fallbackFactory = EsFallbackFactory.class)
public interface EsFeignClientt {
    @PostMapping("/es/save")
    AjaxResult save(@RequestBody CourseDoc courseDoc);

    @RequestMapping("/es/delete/{id}")
     AjaxResult delete(@PathVariable("id") Long id);
    @RequestMapping("/es/seach")
    List<CourseDoc> seach(@RequestBody CourseQuery courseQuery);
}
